import com.troyworks.autocomplete.WordComplete;
import com.troyworks.autocomplete.WordMatch;
/**
 * @author Troy Gardner
 */
class com.troyworks.autocomplete.TestWordComplete {

	public function TestWordComplete() {

				
		
	}
	public function testStates():Void{
				var _ary : Array = new Array();
		_ary.push("a1 word");
		_ary.push("a2 word");
		_ary.push("a2b word");
		_ary.push("a2c word");
		_ary.push("a3");
		_ary.push("b1 word");
		_ary.push("b2 word");
		_ary.push("b3 word");
		var wc : WordComplete = new WordComplete();
		wc.addWordToDictionary(_ary);
	//trace("HIGHLIGHT wc " + wc);	
		var wm:WordMatch = new WordMatch(wc);
		var matches:Array;
		wm.addCharacter("a");
		matches = wm.getMatches();
		trace(wm );
		wm.addCharacter("2");
		matches = wm.getMatches();
		trace(wm );
		wm.addCharacter(" ");
		matches = wm.getMatches();
		trace(wm );

		wm.removeCharacter();
		wm.removeCharacter();
		wm.addCharacter("3");
		matches = wm.getMatches();
		trace(wm );
	}
	public function basicTest():Void{
				var _ary : Array = new Array();
		_ary.push("a1 word");
		_ary.push("a2 word");
		_ary.push("a2b word");
		_ary.push("a2c word");
		_ary.push("a3");
		_ary.push("b1 word");
		_ary.push("b2 word");
		_ary.push("b3 word");
		var wc : WordComplete = new WordComplete();
		wc.addWordToDictionary(_ary);
	//trace("HIGHLIGHT wc " + wc);	
		var wm:WordMatch = new WordMatch(wc);
		var matches:Array;
		wm.addCharacter("a");
		matches = wm.getMatches();
		trace(wm );
		wm.addCharacter("2");
		matches = wm.getMatches();
		trace(wm );
		wm.addCharacter(" ");
		matches = wm.getMatches();
		trace(wm );

		wm.removeCharacter();
		wm.removeCharacter();
		wm.addCharacter("3");
		matches = wm.getMatches();
		trace(wm );
	}
}